<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=utf-8" />
<title><?php echo $title;?></title>
</head>
<body>
<div class="success">
		<br />
		<h2>KIỂM TRA BÁO CÁO KPI</h2>
		<br />
<?php
			ob_start();
			require_once('db.php');
			if(isset($_POST)){	
				$kpi_fn = $_POST['txtkpifn'];
			}		
			foreach($item as $row){
				$sql=mysql_query ("select * from kpi where kpi_person = '$row[name]'");									
				$info = mysql_fetch_array($sql);				
				
				$a = $info['kpi_id'];
			
				$b = $info['kpi_name'];
				
				$c = $info['kpi_unit'];				
					
				$d = $info['kpi_person'];
				
			}
			$mysql = mysql_query("insert into ct_kpi(id, kpi_id, kpi_name, kpi_unit, kpi_person, kpi_finish) value('', '{$a}', '{$b}', '{$c}', '{$d}', '{$kpi_fn}')");
			if($mysql)
				{ echo "Báo cáo thành công";
				} else echo " Có lỗi, xin vui lòng thử lại";
			ob_end_flush();
			?>	

</body>
</html>
